﻿@model iMyRestaurent.Models.NumberingModel
@{
    switch (Model.Mode)
    {
        case iMyRestaurent.Shared.Mode.Create:
        case iMyRestaurent.Shared.Mode.CreateAfterRegistering:
        case iMyRestaurent.Shared.Mode.CreateFromLocationList:
            ViewBag.Title = "iMyRestaurant - Create " + Model.LocationName + " table numbers";
            ViewBag.NextAction = Url.Action("Create", "Availability");
            ViewBag.BackAction = Url.Action("Create", "Layout");
            break;
        case iMyRestaurent.Shared.Mode.EditFromLocation:
        case iMyRestaurent.Shared.Mode.EditFromLayout:
            ViewBag.Title = "iMyRestaurant - Edit " + Model.LocationName + " table numbers";
            ViewBag.NextAction = Url.Action("Edit", "Availability");
            ViewBag.BackAction = Url.Action("Edit", "Layout");
            break;
    }
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section import {
    @NoCache.Instance.Css(Url, "~/Content/table-layout.css")
    @NoCache.Instance.Css(Url, "~/Content/Layout.css")
    @NoCache.Instance.Javascript(Url, "~/Scripts/zoom.js")
}
<div id="title">@ViewBag.Title</div>
<div class="clearfix">
    <div class="right" style="margin: 5px 2px 5px 2px;">
        <input type="button" class="image-button button-zoom-in" />
    </div>
    <div class="right" style="margin: 5px 2px 5px 2px;">
        <input type="button" class="image-button button-zoom-out" />
    </div>
</div>
<div class="opacity-box center-box">
    <div class="auto-height-div clearfix -fl-ah" fla-step="10" id="layout-containment">
        <div id="layout">
            @foreach (var table in Model.Tables)
            {
                string layoutCode = (!string.IsNullOrEmpty(table.LayoutCode) && Convert.ToInt32(table.LayoutCode) > 0) ? table.LayoutCode : "";
                <div class="table" id="@table.TableID" style="@table.Css.Table">
                    <div class="table-elements">
                        <div class="layout-code" style="@table.Css.Layout">@layoutCode</div>
                        <div class="number-seat center-box" style="@table.Css.Number">
                            <div style="@table.Css.NumberText">@table.NoOfChairs</div>
                        </div>
                    </div>
                </div>
            }
        </div>
    </div>
    <div class="clearfix" style="margin-top: 20px;">
        <div class="left">
            <input type="button" class="button-back image-button" />
        </div>
        <div class="left">
            <input type="button" class="image-button button-restart" />
        </div>
        <div class="left" style="margin: 7px 5px 0 20px;">
            <text>Start number:</text>
        </div>
        <div class="left" style="margin-top: 3px;">
            <input type="text" id="txt-start-number" value="@Model.StartNumber" size="5" />
        </div>
        <div class="right">
            <input type="button" class="image-button button-save-layout" />
        </div>
    </div>
</div>
<form method="post" id="back" action="@ViewBag.BackAction">
<input type="hidden" name="LocationID" value="@Model.LocationID" id="location-id" />
<input type="hidden" name="Mode" value="@Model.Mode" />
<input type="hidden" name="LocationName" value="@Model.LocationName" />
<input type="hidden" name="TablePositionText" id="table-position-text" />
<input type="hidden" name="SummaryDate" value="@Model.SummaryDate" />
<input type="hidden" name="SummaryLocationID" value="@Model.SummaryLocationID" />
<input type="hidden" name="LayoutZoomScale" value="@Model.LayoutZoomScale" />
</form>
<form method="post" id="next" action="@ViewBag.NextAction">
<input type="hidden" name="SummaryDate" value="@Model.SummaryDate" />
<input type="hidden" name="SummaryLocationID" value="@Model.SummaryLocationID" />
<input type="hidden" name="LocationID" value="@Model.LocationID" />
<input type="hidden" name="Mode" value="@Model.Mode" />
<input type="hidden" name="LocationName" value="@Model.LocationName" />
<input type="hidden" name="LayoutZoomScale" value="@Model.LayoutZoomScale" />
</form>
@section script {
    @NoCache.Instance.Javascript(Url, "~/Scripts/numbering.js")
}
